package com.sxjh.entity.param;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
public class TaskAddParam {

    private Integer id;

    @ApiModelProperty(value = "计划单ID")
    @TableField("planned_order_id")
    private Integer plannedOrderId;

    @ApiModelProperty(value = "车号ID")
    @NotNull(message = "车号ID不能为空")
    private Integer wagonNumberId;

    @ApiModelProperty(value = "物料ID")
    //@NotNull(message = "物料ID不能为空")
    private Integer materialId;

    @ApiModelProperty(value = "装货点ID")
    //@NotNull(message = "装货点ID不能为空")
    private Integer loadId;

    @ApiModelProperty(value = "卸货点ID")
    //@NotNull(message = "卸货点ID不能为空")
    private Integer unloadId;

    /**
     * 开始日期
     */
    @ApiModelProperty(value = "派车单开始日期")
    @DateTimeFormat(fallbackPatterns = {"yyyy-MM-dd+HH:mm:ss", "yyyy-MM-dd HH:mm:ss"})
    private LocalDateTime startDate;

    /**
     * 结束日期
     */
    @ApiModelProperty(value = "派车单结束日期")
    @DateTimeFormat(fallbackPatterns = {"yyyy-MM-dd+HH:mm:ss", "yyyy-MM-dd HH:mm:ss"})
    private LocalDateTime endDate;

    @ApiModelProperty(value = "拉运次数")
    @Min(value = 1, message = "拉运次数只能1到300之间")
    @Max(value = 300, message = "拉运次数只能1到300之间")
    private Integer count = 1;

}
